#!/bin/sh

echo "SLPFindSrvTypes"
rm -f SLPFindSrvTypes.actual.output
scriptdir=${srcdir}/SLPFindSrvTypes

test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid
../slpd/slpd -r ${scriptdir}/slp.test.reg -p ${srcdir}/slpd.pid
RESULT=$?
if test $RESULT != 0; then
    echo "Unable to start slpd (error = $RESULT), test failed."
    exit $RESULT
fi

./testslpfindsrvtypes "*" >> SLPFindSrvTypes.actual.output
echo >> SLPFindSrvTypes.actual.output
./testslpfindsrvtypes "" >> SLPFindSrvTypes.actual.output
echo >> SLPFindSrvTypes.actual.output
./testslpfindsrvtypes "JUNK" >> SLPFindSrvTypes.actual.output
echo >> SLPFindSrvTypes.actual.output
./testslpfindsrvtypes "OPENSLP" >> SLPFindSrvTypes.actual.output

test -f ${srcdir}/slpd.pid && kill `cat ${srcdir}/slpd.pid` && rm ${srcdir}/slpd.pid
diff -c ${scriptdir}/SLPFindSrvTypes.expected.output SLPFindSrvTypes.actual.output
